
authInterceptorService.$inject = ['$rootScope'];

function  authInterceptorService($rootScope) {
    return {
        request: function(config) {
            console.log('all222222');
            if($rootScope.user!=undefined&&$rootScope.user.token!=undefined){
                config.headers['token'] = $rootScope.user.token;
            }
            // config.headers['token'] = 5555;
            return config;
        },
        /*
         * 超时处理、未授权、在这里定义规则
         */
        response: function(response) {
            console.log('allen111111111');
            return response;
        },
        responseError:function (response) {
            return response;
        }

    };
}
module.exports=authInterceptorService;